

    // 游客量同比分析
    function myChart2(id,selectData,selectDate) {
        var myChart = echarts.init(document.getElementById(id));
        option = {
            grid: {
                top: '16%',
                left: '1%',
                right: '1%',
                bottom: '8%',
                containLabel: true,
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'line'
                }
            },

            xAxis: [{
                type: 'category',
                boundaryGap: true,
                axisLine: { //坐标轴轴线相关设置。数学上的x轴
                    show: true,
                    lineStyle: {
                        color: 'rgba(255,255,255,.3)'
                    },
                },
                axisLabel: { //坐标轴刻度标签的相关设置
                    textStyle: {
                        color: 'rgba(255,255,255,.6)',
                        margin: 15,
                    },
                },
                axisTick: {
                    show: false,
                },
                data:selectDate ,
            }],
            yAxis: [{
                type: 'value',
                min: 0,
                // max: 140,
                name:"(人次)",
                nameTextStyle:{
                    color:'#fff'
                },
                splitNumber: 7,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#0a3256'
                    }
                },
                axisLine: {
                    show: false,
                },
                axisLabel: {
                    margin: 20,
                    textStyle: {
                        color: 'rgba(255,255,255,.6)',

                    },
                },
                axisTick: {
                    show: false,
                },
            }],
            series: [{
                type: 'line',
                // smooth: true, //是否平滑曲线显示
                // 			symbol:'circle',  // 默认是空心圆（中间是白色的），改成实心圆
                showAllSymbol: true,
                symbol: 'circle',
                symbolSize: 6,
                smooth: true,
                // lineStyle: {
                //     normal: {
                //         color:  chartColor[0], // 线条颜色
                //     },
                // },
                label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#fff',
                    }
                },
                itemStyle: {
                    normal: {
                        color: chartColor[0],

                    }
                },
                areaStyle: { //区域填充样式
                    normal: {
                        //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(0,154,120,1)'
                        },
                            {
                                offset: 1,
                                color: 'rgba(0,0,0, 0)'
                            }
                        ], false),
                        shadowColor: 'rgba(53,142,215, 0.9)', //阴影颜色
                        shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                    }
                },
                data:selectData,
            }]
        };
        myChart.setOption(option);
    }

    // 节假日客流
    function myChart4(id,holidayData) {
        var myChart = echarts.init(document.getElementById(id));
        let date= [],data=[]
        holidayData.map(item=>{
            data.push(item.value)
            date.push(item.name)
        })
        option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },

            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                data: date,
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#063374",
                        width: 1,
                        type: "solid"
                    }
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: "#00c7ff",
                    }
                },
            }],
            yAxis: [{
                name:'(万人次)',
                type: 'value',
                min:0,
                splitNumber:7,
                axisLabel: {
                    formatter: '{value}'
                },
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: false,
                    lineStyle: {
                        color: "#00c7ff",
                        width: 1,
                        type: "solid"
                    },
                },
                splitLine: {
                    show:false,
                    lineStyle: {
                        color: "#063374",
                    }
                }
            }],
            series: [{
                name: '游客量',
                type: 'bar',
                data,
                barWidth: 10, //柱子宽度
                barGap: 1, //柱子之间间距
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(0,228,255,1)'
                        }, {
                            offset: 1,
                            color: 'rgba(0,228,255,0)'
                        }]),
                        opacity: 1,
                    }
                }
            },]
        };
        myChart.setOption(option);
    }

